package pl.edu.pw.stud.ltrzaska.mvc.view;

import java.beans.PropertyChangeEvent;
import java.util.Queue;
import java.util.concurrent.BlockingQueue;

import javax.swing.JPanel;

import pl.edu.pw.stud.ltrzaska.mvc.model.AbstractModel;
import pl.edu.pw.stud.ltrzaska.mvc.model.Model;

public abstract class AbstractViewPanel extends JPanel {

	private static final long serialVersionUID = 1L;
	protected BlockingQueue<ViewEvent> controllerQueue;
	protected AbstractModel model;
	
	public abstract void modelPropertyChange(PropertyChangeEvent evt);
	
	AbstractViewPanel(BlockingQueue<ViewEvent> queue) {
		this.controllerQueue = queue;
	}
	
	public void setControllerQueue(BlockingQueue<ViewEvent> controllerQueue) {
		this.controllerQueue = controllerQueue;
	}

	public Queue<ViewEvent> getControllerQueue() {
		return controllerQueue;
	}

	public void setModel(Model majorModel) {
		this.model = majorModel;
	}
	
	public AbstractModel getModel(Model majorModel) {
		return this.model;
	}
}
